package org.brisling.domain.common;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.MappedSuperclass;

import org.brisling.util.DateUtil;


@MappedSuperclass
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class BaseDomain {
	
	@Id
	@Column(name="id")
	@GeneratedValue(strategy=GenerationType.AUTO)
	protected Long id;
	
	@Column
	protected Long bizid;	
	
	
	@Column
	protected String identify;
	
	@Column
	protected String name;
	
	@Column
	protected Integer sortedid;
	
	@Column
	protected Date createTime;
	
	
	
	@Column(name="comments")
	protected String comment;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	

	public Long getBizid() {
		return bizid;
	}

	public void setBizid(Long bizcode) {
		this.bizid = bizcode;
	}

	public String getIdentify() {
		return identify;
	}

	public void setIdentify(String identify) {
		this.identify = identify;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getSortedid() {
		return sortedid;
	}

	public void setSortedid(Integer sortedid) {
		this.sortedid = sortedid;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}	
	
	public String getCreateTimeJson(){
		
		return DateUtil.date2JsonStr(createTime);
	}
	
	public void setCreateTimeJson(String date){
		
		this.setCreateTime(DateUtil.JsonStr2Date(date));
	}

}
